package br.com.fidalgotecnologia.layar.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

@Entity
@Table(schema="poi", name="object")
@SequenceGenerator(sequenceName="poi.object_id_seq" , name="object_seq")
public class Object implements Serializable {
	private Long id;
	private String contentType;
	private byte[] file;
	private byte[] reducedFile;
	private int size;
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="object_seq")
	@Column(name="id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Type(type="org.hibernate.type.BinaryType")
	@Column(name="file", columnDefinition = "bytea")
	public byte[] getFile() {
		return file;
	}
	public void setFile(byte[] file) {
		this.file = file;
	}
	@Type(type="org.hibernate.type.BinaryType")
	@Column(name="reduce_file", columnDefinition = "bytea")
	public byte[] getReducedFile() {
		return reducedFile;
	}
	public void setReducedFile(byte[] reducedFile) {
		this.reducedFile = reducedFile;
	}
	@Column(name="obj_size")
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	@Column(name="content_type")
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	
}
